<?php
$db = null;

try {
    $db = new PDO("mysql:dbname=contact_db;host=127.0.0.1", "root", "000000", array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
} catch (Exception $e) {
    die($e->getMessage());
    $db=null;
}
